package cn.xuqiudong.backend.module.system.param.controller;

import cn.xuqiudong.backend.base.controller.BaseGenericBackendController;
import cn.xuqiudong.backend.module.system.param.model.SysParameter;
import cn.xuqiudong.backend.module.system.param.service.SysParameterService;
import cn.xuqiudong.common.base.model.BaseResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 功能: :参数项表 控制层
 *
 * @author Vic.xu
 * @since 2025-04-25 10:11
 */
@RestController
@RequestMapping("/system/param")
public class SysParameterController extends BaseGenericBackendController<SysParameterService, SysParameter> {


    /**
     * 获取全部的参数,或者某个module的参数
     */
    @GetMapping(value = "/list")
    public BaseResponse<List<SysParameter>> list(@RequestParam(required = false) String  module) {
        SysParameter lookup = new SysParameter();
        lookup.setModule(module);
        List<SysParameter> list = service.list(lookup);
        return BaseResponse.success(list);
    }
}
